/**
 * vector模板类
 */
 #include <iostream>
 #include <vector>

 using namespace std;

 int main()
 {
    vector<int> v = {1, 2, 3, 4, 5};
    for (int i = 0; i < v.size(); ++i)
    {
        cout << v[i] << " ";
    }
    cout << endl;

    v.push_back(1024);
    for (int i = 0; i < v.size(); ++i)
    {
        cout << v[i] << " ";
    }
    cout << endl;

    v[1] = 2048;
    for (int i = 0; i < v.size(); ++i)
    {
        cout << v[i] << " ";
    }
    cout << endl;
    
    return 0;
 }